using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PIM_InfoMap : EntityTypeConfiguration<PIM_Info>
    {
        public PIM_InfoMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Subject)
                .HasMaxLength(100);

            this.Property(t => t.Importance)
                .HasMaxLength(1);

            this.Property(t => t.Status)
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("PIM_Info");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Subject).HasColumnName("Subject");
            this.Property(t => t.Domain).HasColumnName("Domain");
            this.Property(t => t.Paragrah).HasColumnName("Paragrah");
            this.Property(t => t.Information).HasColumnName("Information");
            this.Property(t => t.Moral).HasColumnName("Moral");
            this.Property(t => t.Action).HasColumnName("Action");
            this.Property(t => t.Opinion).HasColumnName("Opinion");
            this.Property(t => t.Idea).HasColumnName("Idea");
            this.Property(t => t.Expressions).HasColumnName("Expressions");
            this.Property(t => t.ToRead).HasColumnName("ToRead");
            this.Property(t => t.ToResearch).HasColumnName("ToResearch");
            this.Property(t => t.ToTry).HasColumnName("ToTry");
            this.Property(t => t.ToMemorize).HasColumnName("ToMemorize");
            this.Property(t => t.Infobits).HasColumnName("Infobits");
            this.Property(t => t.Importance).HasColumnName("Importance");
            this.Property(t => t.Gem).HasColumnName("Gem");
            this.Property(t => t.CreatedON).HasColumnName("CreatedON");
            this.Property(t => t.ReadCount).HasColumnName("ReadCount");
            this.Property(t => t.LastRead).HasColumnName("LastRead");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
